package com.ssy.jt808.protocol.util;

import io.netty.buffer.ByteBuf;
import org.apache.commons.codec.binary.Hex;

/**
 * 16进制转换
 * 2022/6/20
 */
public class HexUtil{

    public static String encodeString(ByteBuf src,int length){
        ByteBuf slice = src.slice(0, length);
        return Hex.encodeHexString(slice.array());
    }



    public static String encodeString(ByteBuf src){
        return Hex.encodeHexString(src.array());
    }
}
